package com.watson.s2sh.platform.service;

import java.util.List;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.watson.s2sh.platform.dao.PermissionDao;
import com.watson.s2sh.platform.domain.Permission;

public class PermissionServiceImpl implements PermissionService {
	private PermissionDao permissionDao;

	@Transactional(propagation = Propagation.REQUIRED)
	public void save(Permission permission) {
		permissionDao.save(permission);
	}

	@Transactional(propagation = Propagation.REQUIRED)
	public Permission get(Long id) {
		return permissionDao.get(id);
	}

	@Transactional(propagation = Propagation.REQUIRED)
	public void delete(Permission permission) {
		permissionDao.delete(permission);
	}

	@Transactional(propagation = Propagation.REQUIRED)
	public List<Permission> findAllPermission() {
		List<Permission> permissionList = permissionDao.findAllPermission();
		return permissionList;
	}
	
	public PermissionDao getPermissionDao() {
		return permissionDao;
	}

	public void setPermissionDao(PermissionDao permissionDao) {
		this.permissionDao = permissionDao;
	}

}
